﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Microsoft.Web.Mvc"%>
<asp:Content ID="indexHead" ContentPlaceHolderID="head" runat="server">
    <title>Home Page</title>
</asp:Content>

<asp:Content ID="css_js" ContentPlaceHolderID="js_css" runat="server">

    <script type="text/javascript" src="/scripts/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery.jcarousel.min.js"></script>
    <style type="text/css">
    .jcarousel-skin-tango .jcarousel-container-horizontal {
        width: 417px;	
    }
    .jcarousel-skin-tango .jcarousel-clip-horizontal {
        width: 430px;
	    height: 150px;
    }
    .jcarousel-skin-tango .jcarousel-item {
        width: 125px;
        height: 150px;
    }
    </style>
    <script type="text/javascript">

        jQuery(document).ready(function() {
            // Initialise the first and second carousel by class selector.
            // Note that they use both the same configuration options (none in this case).
            jQuery('.first-and-second-carousel').jcarousel({ visible: 3 });


        });

    </script>
</asp:Content>
<asp:Content ID="indexContentLeft" ContentPlaceHolderID="left_content" runat="server">
    <!--Start Feature book-->
    <div class="title"><span class="title_icon"><img src="/content/images/bullet1.gif" alt="" title="" /></span>Sách Được Ưa Chuộng</div>
	<% string[][] featureProduct = (string[][])ViewData["feature"]; %>
	<% if (featureProduct != null && featureProduct.Length > 0)
    {%>
    <% foreach (string[] row in featureProduct){ %>
    <% if (row != null){%>    
    <div class="feat_prod_box">
        <div  class="prod_img"><a  id = "feat_pro_<%= row[6] %>" href="/book/detail?id=<%= row[6]%>"><img src="<%= row[7]%>" onerror=this.src='/content/images/no_image.jpg' width="100" height="140" alt="<%= Html.Encode(row[1]) %>" title="" border="0" /></a></div>
             <div class="prod_det_box">
                <div class="box_top"></div>
                <div class="box_center">
                    <div class="prod_title" ><%= row[1] %> &nbsp<span title="
                        <div style='width:300px'>
					        <div style='float:left;margin-left:5px;'>
						         <center><img onerror=this.src='/content/images/no_image.jpg' width='98' height='140' src='<%= row[7]%>'></center>
					        </div>
					        <div style='float:left;margin-left:25px'>
					             <div class='tt_name'>
						              <%= row[1]%>
					             </div>
					             <div class='tt_detail'>
						              <b>Mã Sách : </b><%= row[0]%> <br/><br/>
						              <b>Tác Giả : </b><%= row[2]%> <br/><br/>
						              <b>Giá Bán : </b><%= Html.Encode(row[3])%> <br/><br/>
						              <b>Giá Thuê : </b><%= Html.Encode(row[4])%> <br/><br/>
						              <b>Ngày Cập Nhật : </b><%= Html.Encode(row[8])%><br/><br/>
					             </div>
					        </div>
					        <div style='clear:both;'></div>	
				            </div>"><img width="15" height="15" style="position:relative;top:2px;cursor:pointer;" src="/content/images/icon_search_2.gif"/></span></div>
				
                    <p class="details"><%= row[9]%></p>
                    <a href="/book/detail?id=<%= row[6]%>" class="more">- Chi Tiết -</a>
                    <div class="clear"></div>
                    </div>
                   
                    <div class="box_bottom"></div>
                </div>    
            <div class="clear"></div>
     </div>
     <%}} %>
     <%}else{ %>
        <div class="feat_prod_box">
            <div align="center">
                <span>Không có sách được ưu chuộng !</span>        
            </div> 
        </div>     
     <%} %>
     <!--End Feature book-->
     
     
     <!-- Start New Book -->
           <div class="title"><span class="title_icon"><img src="/content/images/bullet2.gif" alt="" title="" /></span>Sách Mới</div> 
			<% string[][] newProduct = (string[][])ViewData["news"]; %>
			<% if(newProduct != null && newProduct.Length > 0){%>           
           <div class="new_products" style="margin-left:-10px;">
					<div style="margin-top:60px;">
					<ul id="first-carousel" class="first-and-second-carousel jcarousel-skin-tango">
                    <% foreach(string[] row in newProduct){ %>
                    <% if(row !=null) {%>
					        <li>
					        <a href="/book/detail?id=<%= Html.Encode(row[2]) %>" ><img onerror=this.src='/content/images/no_image.jpg' src="<%= Html.Encode(row[1]) %>" width="125" height="125" alt="<%= Html.Encode(row[0]) %>" /></a><br />
					        <div align="center" style="margin-top:5px;color:#F8981D;">
					        <a href="/book/detail?id=<%= Html.Encode(row[2]) %>" style="text-decoration:none;"><%= Html.Encode(row[0]) %></a>
					        </div>
					        </li>
					<% }} %>
				    </ul>  
				  </div>
            </div>
            <%}else{ %>
            <div class="new_products">
                <div align="center">
                    <span>Không có sách mới !</span>        
                </div> 
            </div>
            <%} %>        
     <!-- End New Book -->
</asp:Content>

<asp:Content ID="indexContentRight" ContentPlaceHolderID="right_content" runat="server">
   <% Html.RenderAction("index","sidebar"); %>
</asp:Content>
